Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New-style tasks/workflows use user exception scope #540

Closed

Conversation

slai
Copy link
Contributor

@slai slai commented Jul 7, 2021

TL;DR

New-style tasks/workflows are currently not wrapped in a user exception scope, so all exceptions in user code are treated as unknown system errors which are automatically retried. Further context - https://flyte-org.slack.com/archives/CREL4QVAQ/p1625581856326400

This PR restores the user exception scope to new-style tasks/workflows so exceptions in user code are not retried unless FlyteRecoverableException is raised.

Type

  • Bug Fix
  • Feature
  • Plugin

Are all requirements met?

  • Code completed
  • Smoke tested
  • Unit tests added
  • Code documentation added
  • Any pending items have an associated Issue

Complete description

Based on https://github.com/flyteorg/flytekit/pull/440/files, but I tried to keep the user scope as tightly restricted to user code as possible.

New-style tasks/workflows are currently not wrapped in a user exception scope, so all exceptions in user code are treated as unknown system errors which are automatically retried. Further context - https://flyte-org.slack.com/archives/CREL4QVAQ/p1625581856326400

This PR restores the user exception scope to new-style tasks/workflows so exceptions in user code are not retried unless FlyteRecoverableException is raised.
@@ -96,7 +96,11 @@ def _dispatch_execute(
c: OR if an unhandled exception is retrieved - record it as an errors.pb
"""
output_file_dict = {}
try:

@_scopes.system_entry_point
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Although _dispatch_execute is already being executed in a system exception scope, that scope is too far up the stack to wrap exceptions raised in this function so the subsequent except blocks below can handle them.

@codecov
Copy link

codecov bot commented Jul 7, 2021

Codecov Report

Merging #540 (838fd4c) into master (1da094b) will increase coverage by 0.00%.
The diff coverage is 88.88%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master     #540   +/-   ##
=======================================
  Coverage   85.37%   85.37%           
=======================================
  Files         371      371           
  Lines       28710    28724   +14     
  Branches     2310     2310           
=======================================
+ Hits        24510    24523   +13     
- Misses       3561     3562    +1     
  Partials      639      639           
Impacted Files Coverage Δ
flytekit/core/map_task.py 80.64% <66.66%> (+0.21%) ⬆️
flytekit/core/python_function_task.py 85.10% <100.00%> (+0.16%) ⬆️
flytekit/core/workflow.py 88.79% <100.00%> (+0.03%) ⬆️
flytekit/core/python_auto_container.py 81.18% <0.00%> (-1.99%) ⬇️
...-sqlalchemy/flytekitplugins/sqlalchemy/__init__.py
...gins-sqlalchemy/flytekitplugins/sqlalchemy/task.py
...ekit-sqlalchemy/flytekitplugins/sqlalchemy/task.py 90.47% <0.00%> (ø)
...-sqlalchemy/flytekitplugins/sqlalchemy/__init__.py 100.00% <0.00%> (ø)
plugins/tests/sqlalchemy/test_task.py 97.91% <0.00%> (+0.29%) ⬆️
flytekit/common/exceptions/scopes.py 88.37% <0.00%> (+0.77%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 1da094b...838fd4c. Read the comment docs.

@slai
Copy link
Contributor Author

slai commented Jul 13, 2021

Closing as #543 has fixed this

@slai slai closed this Jul 13, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant